package com.example.ssm.service.impl;


import com.example.ssm.dao.DaoFactory;
import com.example.ssm.dao.UserDao;
import com.example.ssm.entity.User;
import com.example.ssm.service.UserService;
import org.springframework.stereotype.Service;

import java.io.IOException;
import java.util.List;
@Service("UserService")
public class UserServiceImpl implements UserService  {


    @Override
    public User login(User user) throws IOException {
        UserDao dao=DaoFactory.getUserDao();
        return dao.getLoginUserByname(user);
    }

    @Override
    public boolean submit(User user) throws IOException {
        UserDao dao=DaoFactory.getUserDao();
        return dao.insertUser(user);
    }

    @Override
    public List<User> selectAllUser() throws IOException {
        UserDao dao=DaoFactory.getUserDao();
        return dao.selectAllUser();
    }




    @Override
    public List<User> selectLikePermission(User user) throws IOException {
        UserDao dao=DaoFactory.getUserDao();
        return dao.selectLikePermission(user);
    }

    @Override
    public List<User> selectLikeUnamePermission(User user) throws IOException {
        UserDao dao=DaoFactory.getUserDao();
        return dao.selectLikeUnamePermission(user);
    }



    @Override
    public List<User> selectLikeUnamePhonenumberPermission(User user) throws IOException {
        UserDao dao=DaoFactory.getUserDao();
        return dao.selectLikeUnamePhonenumberPermission(user);
    }

    @Override
    public List<User> selectLikePermissionphonenumber(User user) throws IOException {
        UserDao dao=DaoFactory.getUserDao();
        return dao.selectLikePermissionphonenumber(user);
    }

    @Override
    public boolean addShop(User user) throws IOException {
        UserDao dao=DaoFactory.getUserDao();
        return dao.addShop(user);
    }

    @Override
    public User selectByName(User user) throws IOException {
        UserDao dao=DaoFactory.getUserDao();

        return dao.selectByName(user);
    }

    @Override
    public boolean addMoney(User user) throws IOException {
        UserDao dao=DaoFactory.getUserDao();

        return dao.addMoney(user);
    }


}
